
import config from "./config/index";

import Koa from 'koa'
import cors from '@koa/cors';
import bodyparser from 'koa-bodyparser'
import useRoutes from "./router/index"
import hlemet from 'koa-helmet'
import respond from './koa/resp/index'
import parameter from './koa/parameter/index'
const app = new Koa();
app
  .use(hlemet())
  .use(cors())
  .use(bodyparser())
  .use(parameter())
  .use(respond())
  ;
  // 这个要放在后面（需要把上面插件初始化
useRoutes(app)

app.listen(config.SERVER_PORT, () => {
  console.debug(`http://localhost:${config.SERVER_PORT} `);
});
